import { role } from '@/utils/const/constant'
export default (layout) => {
  return {
    path: '/document',
    component: layout,
    redirect: '/document/list',
    meta: {
      title: 'document',
      icon: 'wenzhangguanli',
      roles: [role.admin, role.user]
    },
    children: [
      {
        path: '/document/list',
        name: 'documentList',
        component: () =>
          import(/* webpackChunkName: "document" */ '@/views/document/list'),
        meta: {
          title: 'documentList',
          icon: 'wenzhangfenlei',
          roles: [role.admin, role.user, role.manager]
        }
      },
      {
        path: '/document/:id',
        name: 'documentDetail',
        component: () =>
          import(/* webpackChunkName: "document" */ '@/views/document/detail'),
        meta: {
          roles: [role.admin, role.user, role.manager]
        }
      },
      {
        path: '/document/create',
        name: 'documentCreate',
        component: () =>
          import(/* webpackChunkName: "document" */ '@/views/document/create'),
        meta: {
          title: 'articleCreate',
          icon: 'xinjian',
          roles: [role.admin, role.user, role.manager]
        }
      },
      {
        path: '/document/editor/:id',
        name: 'documentEditor',
        component: () =>
          import(/* webpackChunkName: "document" */ '@/views/document/create'),
        meta: {
          title: 'documentEditor',
          roles: [role.admin, role.user, role.manager]
        }
      }
    ]
  }
}
